package com.beordie.version_2.aop;

import com.beordie.version_2.aop.config.BODAopConfig;
import com.beordie.version_2.aop.support.BODAdviseSupport;

/**
 * @Description 代理类创建工厂
 * @Date 2022/2/19 9:31
 * @Created 30500
 */
public class BODDefaultAopProxyFactory {
    private BODAdviseSupport config;

    public BODAopProxy createAopProxy(BODAdviseSupport config) {
        if (config.getTargetClass().getInterfaces().length > 0) {
            return new BODJdkDynamicAopProxy(config);
        }
        return new BODCglibAopProxy(config);
    }
}
